import Main from "../views/main/Main.vue"; //首页
import Login from "../views/Login.vue";

import Customer from "../views/customer/Index.vue";
import CustomerIndex from "../views/customer/CustomerIndex.vue"; //客户管理首页
import CustomerDetail from "../views/customer/CustomerDetail.vue"; //客户详情

import Delegete from "../views/delegete/DelegeteIndex.vue"; //代理首页
import DelegeteDetail from "../views/delegete/DelegeteDetail.vue"; //代理详情 编辑

import Goods from "../views/goods/Index.vue"; // 商品首页
import GoodsIndex from "../views/goods/GoodsIndex.vue";
import GoodsAdd from "../views/goods/GoodsAdd.vue"; //商品添加
import GoodsCategory from "../views/goods/GoodsCategory.vue"; //商品类别
import GoodDelegete from "../views/goods/GoodDelegete.vue"; //新增商品代理设置 
import AllianceGood from "../views/goods/AllianceGood.vue"; //商盟商品代理设置 
import AllianceGoodAdd from "../views/goods/AllianceGoodAdd.vue"; //商品添加
import GiftGood from "../views/goods/giftGood.vue"; //礼品管理

import Order from "../views/order/OrderIndex.vue"; //订单首页
import OrderDetail from "../views/order/OrderDetail.vue";

import Finance from "../views/finance/FinanceIndex.vue"; //财务

import Setting from "../views/setting/Index.vue";
import DelegeteSetting from "../views/setting/DelegeteSetting.vue"; //代理设置
import GoodsSetting from "../views/setting/GoodsSetting.vue"; //商品设置
import StoreSetting from "../views/setting/StoreSetting.vue"; //商品设置
import SignInSetting from "../views/setting/SignInSetting.vue"; //签到设置
import PosterSetting from '../views/setting/PosterSetting.vue'

import IntegralSet from "../views/setting/IntegralSet.vue"; //积分设置
import WithdrawalSet from '../views/setting/withdrawalSet.vue' //提现设置
import MemberSetting from '../views/setting/MemberSetting.vue' //会员设置
import GiftSetting from '../views/setting/GiftSetting.vue' //抽奖积分设置
import Ad from "../views/ad/Ad.vue";



import printer from "../views/printer/printer.vue"
import permissions from '../views/permissions/Permissions.vue'  //角色管理
import userIndex from '../views/user/index.vue'
import User from "../views/user/User.vue";

import addUser from '../views/user/AddUser.vue'
import updateUser from '../views/user/UpdateUser.vue'

import MenuList from '../views/MenuList.vue'

import Activity from "../views/activity/Index.vue";
import CouponActivity from '../views/activity/CouponActivity.vue' //优惠券活动首页
import GroupActivity from '../views/activity/GroupActivity.vue' //拼团活动首页
import SeckillActivity from '../views/activity/SeckillActivity.vue' //秒杀活动首页
import OneActivity from '../views/activity/OneActivity.vue' //一口价活动首页
import AllianceActivity from '../views/activity/AllianceActivity.vue' // 商盟活动首页
import LuckActivity from '../views/activity/LuckActivity.vue' // 抽奖活动首页
import GiftActivity from '../views/activity/GiftActivity.vue' // 礼品兑换券活动首页
import addCoupon from '../views/activity/AddCoupon.vue' //添加优惠券
import CouponDetail from '../views/activity/CouponDetail.vue' // 优惠券详情
import AddSeckill from '../views/activity/AddSeckill.vue' // 添加秒杀
import SeckillDetail from '../views/activity/SeckillDetail.vue' // 秒杀详情
import AddGroup from '../views/activity/AddGroup.vue' // 添加拼团
import GroupDetail from '../views/activity/GroupDetail.vue' // 拼团详情
import AddOne from '../views/activity/AddOne.vue' // 添加一口价
import OneDetail from '../views/activity/OneDetail.vue' // 一口价详情
import AllianceManJ from '../views/activity/AllianceManJ.vue' // 商盟活动满减报名
import AllianceZheK from '../views/activity/AllianceZheK.vue' // 商盟活动折扣报名
import LuckActivityAdd from '../views/activity/LuckActivityAdd.vue' // 添加抽奖活动
import LuckActivityDetail from '../views/activity/LuckActivityDetail.vue' // 抽奖活动详情
import GiftActivityAdd from '../views/activity/GiftActivityAdd.vue' // 礼品兑换券新增
import GiftActivityDetail from '../views/activity/GiftActivityDetail.vue' // 礼品兑换券详情

import FreightManage from '../views/freight/freightManage.vue' // 运费管理首页
import FreightAdd from '../views/freight/freightAdd.vue' // 添加运费
import FreightDetail from '../views/freight/freightDetail.vue' // 运费详情
import freightIndex from '../views/freight/index.vue' //

import GoGood from '../views/stock/goGood.vue' //进货记录
import GoGoodAdd from '../views/stock/goGoodAdd.vue' //进货记录添加
import GoGoodDetail from '../views/stock/goGoodDetail.vue'
import GoHousing from '../views/stock/goHousing.vue' //入库记录
import SaleRecord from '../views/stock/saleRecord.vue' //销售记录
import GoodStock from '../views/stock/goodStock.vue' //商品库存
import StockProfitLoss from '../views/stock/stockProfitLoss.vue' // 库存损益记录
import StockChecking from '../views/stock/stockChecking.vue' // 库存盘点记录
import StockCheckingAdd from '../views/stock/stockCheckingAdd.vue' // 新增库存盘点记录
import StockCheckingDetail from '../views/stock/stockCheckingDetail.vue' //库存盘点记录详情 
import GoGoodApproval from '../views/stock/goGoodApproval.vue' // 分店进货审批

import DelegeteNew from '../views/delegeteNew/delegeteNew.vue' //代理管理
import DelegeteNewAdd from '../views/delegeteNew/delegeteNewAdd.vue' //
import DelegeteNewDetail from '../views/delegeteNew/delegeteNewDetail.vue' //

import Evaluate from '../views/evaluate/evaluate.vue' //评价管理
import Withdrawal from '../views/withdrawal/withdrawal.vue' //提现管理 

import Member from '../views/member/Member.vue' //会员管理
import Card from '../views/card/Card.vue' //储值卡管理
import Production from '../views/production/production.vue' //生产管理
import Distribution from '../views/distribution/distribution.vue' //配送调度

import WxSetting from '../views/wxSetting/wxSetting.vue' //小程序设置
// export const constantRouterMap = [
//     {
//         path: "/",
//         name: "Login",
//         meta: { title: "登录", isHide: true },
//         components: {
//             login: Login,
//         },
//     },
//     {
//         path: "/main",
//         name: "Main",
//         meta: { title: "首页" },
//         component: Main,
//     }
// ]

// //实例化vue的时候只挂载constantRouter
// export default new Router({
//     routes: constantRouterMap
// });

// //异步挂载的路由
// //动态需要根据权限加载的路由表 
// export const asyncRouterMap = [
//     {
//         path: '/permission',
//         component: Layout,
//         name: '权限测试',
//         meta: { role: ['admin', 'super_editor'] }, //页面需要的权限
//         children: [
//             {
//                 path: 'index',
//                 component: Permission,
//                 name: '权限测试页',
//                 meta: { role: ['admin', 'super_editor'] }  //页面需要的权限
//             }]
//     },

// ];


const routes = [{
    path: "/",
    name: "Login",
    meta: { title: "登录", isHide: true },
    components: {
        login: Login,
    },
},

{
    path: "/main",
    name: "Main",
    meta: { title: "首页" },
    component: Main,
},
// {
//     path: "/menuList",
//     name: "Menu",
//     meta: { title: "菜单" },
//     component: MenuList

// },
{
    path: "/customer",
    meta: { title: "客户管理" },
    component: Customer,
    children: [{
        path: "/",
        name: "Customer",
        meta: { title: "客户管理" },
        component: CustomerIndex,
    },
    {
        path: "/customerDetail",
        name: "CustomerDetail",
        component: CustomerDetail,
    },
    ],
},

// {
//     path: "/delegete",
//     name: "Delegete",
//     meta: { title: "代理管理" },
//     component: Delegete,
// },
// {
//     path: "/delegeteDetail/:customerId",
//     name: "DelegeteDetail",
//     meta: { title: "代理详情", isHide: true },
//     component: DelegeteDetail,
// },




{
    path: "/delegeteNew",
    name: "DelegeteNew",
    meta: { title: "代理管理" },
    component: DelegeteNew,
},
{
    path: "/order",
    name: "Order",
    meta: { title: "订单管理" },
    component: Order,
},
{
    path: "/orderDetail",
    name: "OrderDetail",
    meta: { title: "订单详情", isHide: true },
    component: OrderDetail,
},
{
    path: "/finance",
    name: "Finance",
    meta: { title: "财务管理" },
    component: Finance,
},

{
    path: "/ad",
    name: "Ad",
    meta: { title: "广告管理" },
    component: Ad,
},

{
    path: "/user",
    meta: { title: "用户管理" },
    component: userIndex,
    children: [{
        path: "/",
        name: "user",
        meta: { title: "用户管理" },
        component: User,
    }, {
        path: "/addUser",
        name: "addUser",
        meta: { title: "新增用户" },
        component: addUser,
    },
    {
        path: "/updateuser",
        name: "updateuser",
        meta: { title: "编辑用户" },
        component: updateUser,
    }
    ],
},

// {
//     path: "/printer",
//     name: "printer",
//     meta: { title: "打印机管理" },
//     component: printer,
// },
{
    path: "/freightManage",
    meta: { title: "运费管理" },
    component: freightIndex,
    children: [{
        path: "/",
        name: "FreightManage",
        meta: { title: "运费管理" },
        component: FreightManage,
    }, {
        path: "/freightAdd",
        name: "FreightAdd",
        meta: { title: "新增运费模板" },
        component: FreightAdd,
    },
    {
        path: "/freightDetail",
        name: "FreightDetail",
        meta: { title: "运费模板详情" },
        component: FreightDetail,
    }
    ],
},
{
    path: "/goods",
    meta: { title: "商品管理", isExtend: true, path: "/goodsIndex" },
    component: Goods,
    children: [{
        path: "/goodsIndex",
        meta: { isShow: true, title: "商品管理" },
        name: "Goods",
        component: GoodsIndex,
    },
    {
        path: "/goodsCategory",
        meta: { isShow: true, title: "商品类目管理" },
        name: "GoodsCategory",
        component: GoodsCategory,
    },
    {
        path: "/giftGood",
        meta: { isShow: true, title: "礼品管理" },
        name: "GiftGood",
        component: GiftGood,
    },
    // {
    //     path: "/allianceGood",
    //     meta: { isShow: true, title: "商盟商品管理" },
    //     name: "AllianceGood",
    //     component: AllianceGood,
    // },
    {
        path: "/goodsAdd",
        name: "GoodsAdd",
        meta: { title: "商品" },
        component: GoodsAdd,
    },
    {
        path: "/allianceGoodAdd",
        name: "AllianceGoodAdd",
        meta: { title: "商盟商品" },
        component: AllianceGoodAdd,
    },
    {
        path: "/goodDelegete",
        name: "GoodDelegete",
        meta: { title: "商品代理设置" },
        component: GoodDelegete,
    },
    ],
},
{
    path: "/stock",
    meta: { title: "库存管理", isExtend: true, path: "/goGood" },
    component: Activity,
    children: [{
        path: "/goGood",
        meta: { isShow: true, title: "进货记录" },
        name: "GoGood",
        component: GoGood,
    },
    {
        path: "/goHousing",
        name: "GoHousing",
        meta: { isShow: true, title: "入库记录" },
        component: GoHousing,
    },
    {
        path: "/saleRecord",
        name: "SaleRecord",
        meta: { isShow: true, title: "销售记录" },
        component: SaleRecord,
    },
    {
        path: "/goodStock",
        name: "GoodStock",
        meta: { isShow: true, title: "商品库存" },
        component: GoodStock,
    },
    {
        path: "/stockProfitLoss",
        name: "StockProfitLoss",
        meta: { isShow: true, title: "库存损益记录" },
        component: StockProfitLoss,
    },
    {
        path: "/stockChecking",
        name: "StockChecking",
        meta: { isShow: true, title: "库存盘点记录" },
        component: StockChecking,
    },
    {
        path: "/goGoodApproval",
        name: "GoGoodApproval",
        meta: { isShow: true, title: "分店进货审批" },
        component: GoGoodApproval,
    },
    {
        path: "/goGoodAdd",
        name: "GoGoodAdd",
        meta: {
            title: "新增进货记录"
        },
        component: GoGoodAdd,
    },
    {
        path: "/stockCheckingAdd",
        name: "StockCheckingAdd",
        meta: {
            title: "新增盘点记录"
        },
        component: StockCheckingAdd,
    },
    {
        path: "/stockCheckingDetail",
        name: "StockCheckingDetail",
        meta: {
            title: "盘点记录详情"
        },
        component: StockCheckingDetail,
    }
    ],
},
{
    path: "/activity",
    meta: { title: "活动管理", isExtend: true, path: "/couponActivity" },
    component: Activity,
    children: [{
        path: "/couponActivity",
        meta: { isShow: true, title: "优惠券类活动" },
        name: "CouponActivity",
        component: CouponActivity,
    },
    {
        path: "/seckillActivity",
        name: "SeckillActivity",
        meta: { isShow: true, title: "秒杀活动" },
        component: SeckillActivity,
    },
    {
        path: "/groupActivity",
        name: "GroupActivity",
        meta: { isShow: true, title: "拼团活动" },
        component: GroupActivity,
    },
    {
        path: "/oneActivity",
        name: "OneActivity",
        meta: { isShow: true, title: "打包一口价活动" },
        component: OneActivity,
    },
    {
        path: "/luckActivity",
        name: "LuckActivity",
        meta: { isShow: true, title: "抽奖转盘活动" },
        component: LuckActivity,
    },
    {
        path: "/allianceActivity",
        name: "AllianceActivity",
        meta: { isShow: true, title: "商盟活动" },
        component: AllianceActivity,
    },
    {
        path: "/giftActivity",
        name: "GiftActivity",
        meta: { isShow: true, title: "礼品兑换活动" },
        component: GiftActivity,
    },
    {
        path: "/addCoupon",
        name: "addCoupon",
        meta: {
            title: "新增优惠券"
        },
        component: addCoupon,
    },
    {
        path: "/couponDetail",
        name: "couponDetail",
        meta: {
            title: "优惠券详情"
        },
        component: CouponDetail,
    },
    {
        path: "/addSeckill",
        name: "AddSeckill",
        meta: { title: "新增秒杀活动" },
        component: AddSeckill,
    },
    {
        path: "/seckillDetail",
        name: "SeckillDetail",
        meta: { title: "秒杀活动详情" },
        component: SeckillDetail,
    },
    {
        path: "/addGroup",
        name: "AddGroup",
        meta: { title: "新增拼团活动" },
        component: AddGroup,
    },
    {
        path: "/groupDetail",
        name: "GroupDetail",
        meta: { title: "拼团活动详情" },
        component: GroupDetail,
    },
    {
        path: "/addOne",
        name: "AddOne",
        meta: { title: "新增打包一口价活动" },
        component: AddOne,
    },
    {
        path: "/oneDetail",
        name: "OneDetail",
        meta: { title: "打包一口价活动详情" },
        component: OneDetail,
    },
    {
        path: "/allianceManJ",
        name: "AllianceManJ",
        meta: { title: "报名" },
        component: AllianceManJ,
    },
    {
        path: "/allianceZheK",
        name: "AllianceZheK",
        meta: { title: "报名" },
        component: AllianceZheK,
    },
    {
        path: "/luckActivityAdd",
        name: "LuckActivityAdd",
        meta: { title: "新增抽奖转盘活动" },
        component: LuckActivityAdd,
    },
    {
        path: "/luckActivityDetail",
        name: "LuckActivityDetail",
        meta: { title: "抽奖转盘活动详情" },
        component: LuckActivityDetail,
    },
    {
        path: "/giftActivityAdd",
        name: "GiftActivityAdd",
        meta: {
            title: "新增优惠券礼品兑换"
        },
        component: GiftActivityAdd,
    },
    {
        path: "/giftActivityDetail",
        name: "GiftActivityDetail",
        meta: {
            title: "优惠券礼品兑换详情"
        },
        component: GiftActivityDetail,
    },
    ],
},
{
    path: "/withdrawal",
    name: "Withdrawal",
    meta: { title: "提现管理" },
    component: Withdrawal,
},
{
    path: "/permissions",
    name: "permissions",
    meta: { title: "角色管理" },
    component: permissions,
},
{
    path: "/evaluate",
    name: "Evaluate",
    meta: { title: "评价管理" },
    component: Evaluate,
},
{
    path: "/setting",
    meta: { title: "设置管理", isExtend: true, path: "/goodsSetting" },
    component: Setting,
    children: [
        //     {
        //     path: "/delegeteSetting",
        //     meta: { isShow: true, title: "代理设置" },
        //     name: "DelegeteSetting",
        //     component: DelegeteSetting,
        // },
       
        {
            path: "/goodsSetting",
            name: "GoodsSetting",
            meta: { isShow: true, title: "商品设置" },
            component: GoodsSetting,
        },
        {
            path: "/StoreSetting",
            name: "StoreSetting",
            meta: { isShow: true, title: "门店设置" },
            component: StoreSetting,
        },
         {
            path: "/integralSet",
            name: "IntegralSet",
            meta: { isShow: true, title: "积分设置" },
            component: IntegralSet,
        },
        {
            path: "/withdrawalSet",
            name: "WithdrawalSet",
            meta: { isShow: true, title: "提现设置" },
            component: WithdrawalSet,
        },
        {
            path: "/memberSetting",
            name: "MemberSetting",
            meta: { isShow: true, title: "会员设置" },
            component: MemberSetting,
        },
        
        // {
        //     path: "/signInSetting",
        //     name: "SignInSetting",
        //     meta: { isShow: true, title: "签到设置" },
        //     component: SignInSetting,
        // },
        {
            path: "/posterSetting",
            name: "PosterSetting",
            meta: { isShow: true, title: "海报设置" },
            component: PosterSetting,
        },
        {
            path: "/giftSetting",
            name: "GiftSetting",
            meta: { isShow: true, title: "抽奖积分设置" },
            component: GiftSetting,
        },
        {
            path: "/member",
            name: "Member",
            meta: { isShow: true, title: "会员管理" },
            component: Member,
        },
        {
            path: "/card",
            name: "Card",
            meta: { isShow: true, title: "储值卡管理" },
            component: Card,
        },
        {
            path: "/production",
            name: "Production",
            meta: { isShow: true, title: "生产管理" },
            component: Production,
        },
        {
            path: "/distribution",
            name: "Distribution",
            meta: { isShow: true, title: "配送调度" },
            component: Distribution,
        },
        {
            path: "/wxSetting",
            name: "WxSetting",
            meta: { isShow: true, title: "小程序设置" },
            component: WxSetting,
        },
    ],
},


];

export default routes;